package com.net.service.impl;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import com.net.dao.CustomerDao;
import com.net.model.Customer;
import com.net.service.CustomerService;
@Component("customerService")
public class CustomerServiceImpl implements CustomerService {
	private CustomerDao customerDao ;

	public void add(Customer u) throws Exception {
		customerDao.save(u);
	}

	public boolean delete(Customer u) {
		return customerDao.delete(u);
	}

	public List<Customer> getCostomers() throws Exception {
		return customerDao.getCustomers();
	}

	public boolean loadByCustomerName(String name) throws Exception {
		return customerDao.loadCustomerByName(name);
	}

	public Customer loadCustomerById(int id) {
		return customerDao.loadCustomerById(id);
	}

	public CustomerDao getCustomerDao() {
		return customerDao;
	}
	@Resource(name="customerDao")
	public void setCustomerDao(CustomerDao customerDao) {
		this.customerDao = customerDao;
	}

	public void update(Customer customer) {
		this.customerDao.update(customer);
	}

	public List<Customer> searchList(String param1, String param2, String param3) {
		return customerDao.searchList(param1, param2, param3);
	}
	
}
